package com.ideaaedi.zoo.diy.artifact.tenant.properties.nested;

import com.ideaaedi.zoo.commonbase.component.tenant.UserIdAndTenantScope;
import lombok.Data;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;

/**
 * 游客用户id & 租户信息
 *
 * @author <font size = "20" color = "#3CAA3C"><a href="https://gitee.com/JustryDeng">JustryDeng</a></font> <img
 * src="https://gitee.com/JustryDeng/shared-files/raw/master/JustryDeng/avatar.jpg" />
 * @since 1.0.0
 */
@Data
public class VisitorTenantInfo implements UserIdAndTenantScope {
    
    /**
     * 用户id
     */
    private Long userId;
    
    /**
     * 插入时的租户
     */
    private String insertTenant;
    
    /**
     * 读时的租户
     */
    private Collection<String> readableTenants;
    
    /**
     * 写时的租户
     */
    private Collection<String> modifiableTenants;
    
    @Nullable
    @Override
    public String insertTenant() {
        return this.insertTenant;
    }
    
    @Nullable
    @Override
    public Collection<String> readableTenants() {
        return this.readableTenants;
    }
    
    @Nullable
    @Override
    public Collection<String> modifiableTenants() {
        return this.modifiableTenants;
    }
    
    @Nonnull
    @Override
    public Long userId() {
        return this.userId;
    }
}
